<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <script src="https://cdn.bootcdn.net/ajax/libs/lodash.js/4.17.21/lodash.min.js"></script>

  <style>
    ul {
      margin-top: 50px;
      width: 300px;

    }

    li {
      border: 1px solid #000;
      height: 50px;
    }
  </style>
</head>

<body>
  <div>
    <ul>
      <li>1</li>
      <li>1</li>
      <li>1</li>
      <li>1</li>
      <li>1</li>
      <li>1</li>
      <li>1</li>
      <li>1</li>
      <li>1</li>
      <li>1</li>
    </ul>
  </div>
  <script>
    const oLis = document.querySelectorAll('li')
    console.log(oLis);
    function center() {
      this.style.background = 'red'
    }
    function leave() {
      this.style.background = ''
    }
    const mouseenter = _.throttle(center, 30,{leading:true,trailing:false})
    oLis.forEach(item => {
      item.onmouseenter = mouseenter
      item.onmouseleave = leave
    })
  </script>
</body>

</html>